const express = require('express');
const router = express.Router();
const data = [];
for(let i = 1; i < 51; i++)
    data.push({
        id: `${i}`,
        code: `code${i}`,
        name: `name${i}`,
        color: 'string',
        version: 'string',
        package: 'string',
        displacement: 'string',
        transmission: 'string',
        fuelType: 'string',
        interior: 'string',
        remark: 'string'

    });

router.get('/', (req, res) => {
    const {pageIndex, pageSize} = req.query;
    res.json({
        message: 'ok',
        payload: {
            content: data,
            pageIndex: parseInt(pageIndex, 10),
            pageSize: parseInt(pageSize, 10),
            totalElements: 50
        }
    });
});

module.exports = router;
